package conf

import (
	"github.com/spf13/viper"
)

type System struct {
	Addr string `json:"addr" yaml:"addr"`
}

type FilePath struct {
	FilePath string `json:"filePath" yaml:"filePath"`
}

func Viper() {
	v := viper.New()
	v.SetConfigFile("conf/config.yaml")
	v.SetConfigType("yaml")
	err := v.ReadInConfig()
	if err != nil {
		panic(err.Error())
	}
	err = v.Unmarshal(&CONF)
	err = v.Unmarshal(&CLUSTER)
	if err != nil {
		panic(err.Error())
	}
}
